﻿@model List<ESN.Models.UserNotice>
<script type="text/javascript">
    $(document).ready(function () {
        $("#lastMessage").hide();
        var stopLoad = false;
        function Load(skip) {
            var query = "/CoreService.svc/GetUserNotice";
            $.getJSON(query, function (result) {
                $.each(result.d, function (i, item) {
                    $("#theList").append('<div style="border-bottom: 2px solid;">'+item.NContent+'</div>');
                });
            });
        }
        var currentRow = 20;
        $(window).scroll(function () {
            if (($(window).scrollTop() == $(document).height() - $(window).height()) && !stopLoad) {
                $("#lastMessage").show();
                Load(currentRow);
                currentRow = currentRow + 20;
                $("#lastMessage").hide();
            }
        });
    });
</script>
<h2>@ViewBag.Title</h2>

<div id="theList">
@foreach (var n in Model)
{
    <div style="border-bottom: 2px solid;">
        @Html.Raw(n.NContent)
    </div>
}
</div>
